<div class="widgets">
    <div ba-panel ba-panel-title="红包管理" ba-panel-class="with-scroll" style="    overflow: hidden;">
        <div ng-if="is_suer_root.redpacket.indexOf('add')>-1" style="position: absolute;right: 3%;top: 5px;"><button type="button" class="btn btn-info btn-raised" ng-click="myopen('app/pages/redAdminM/newRed/newRed.html', 'lg')">新增</button></div>

        <form class="row form-inline ng-pristine ng-valid ng-scope">
            <div class="row">
                <div class="col-lg-6 col-sm-12">
                    <h5 style="line-height: 30px;" class="col-sm-3 col-xs-5">活动名称:</h5>
                    <div class="form-group  col-sm-8 col-xs-5">
                        <input type="text" class="form-control" id="exampleInputName2" ng-model="list_data_opt.name" placeholder="请输入活动名称">
                    </div>
                </div>
                <div class="col-lg-6 col-sm-12">
                    <div class="form-group col-sm-3 col-xs-6">
                        <h5>红包状态:</h5>
                    </div>
                    <div class="col-sm-8" style="    margin-top: 10px;">
                        <div class="col-sm-3"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="不限" ng-click="list_data_opt.status='all'" ng-checked="list_data_opt.status=='all'"> <span>不限</span></label>
                        </div>
                        <div class="col-sm-3"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="进行中" ng-click="list_data_opt.status='ongoing'" ng-checked="list_data_opt.status=='1'"> <span>进行中</span></label>
                        </div>
                        <div class="col-sm-3"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio3" value="已结束" ng-click="list_data_opt.status='end'" ng-checked="list_data_opt.status=='4'"> <span>已结束</span></label>
                        </div>
                        <div class="col-sm-3"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio4" value="未开始" ng-click="list_data_opt.status='not_start'" ng-checked="list_data_opt.status=='0'"> <span>未开始</span></label>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 日期选择 -->
            <div class='row'>

                <div class="col-lg-6 col-sm-12">
                    <h5 style="line-height: 30px;" class="col-sm-3 col-xs-5">活动日期：</h5>
                    <div class="col-sm-4">
                        <input type="datetime-local" id="dat1" style="width: 100%;" class="form-control border-r5 width-100">
                    </div>
                    <div class="col-sm-4">
                        <input type="datetime-local" id="dat2" style="width: 100%;" class="form-control border-r5 width-100" value="{{new_data}}" ng-model="new_data2">
                    </div>
                    <!--<div class="col-sm-4" style="margin: 10px 0;">(精确至分钟)</div>-->
                </div>

                <div class="col-lg-6 col-sm-12">
                    <div class="col-sm-3">
                        <h5 style="line-height: 35px;">出生日期限制：</h5>
                    </div>
                    <div class="col-sm-4">
                        <input type="date" style="width: 100%;" id="dat3" class="form-control border-r5 width-100" value="{{new_data}}" ng-model="new_data3">
                    </div>
                    <div class="col-sm-4">
                        <input type="date" style="width: 100%;" id="dat4" class="form-control border-r5 width-100" value="{{new_data}}" ng-model="new_data4">
                    </div>
                </div>
            </div>

            <!-- 搜索分页-->
            <div class="row">
                <div class="col-lg-6 col-sm-12">
                    <div class="col-sm-3">
                        <h5 style="line-height: 35px;">区域：</h5>
                    </div>
                    <div class="col-sm-8" ng-controller="AddCtrl">
                        <div class="col-sm-3" style="padding: 2px;">
                            <select style="padding: 2px;" class="form-control" id="add1" ng-model="selectedProvince" ng-options="item[0] as item[1] for item in regionData1">  
                        <option value="" id="add_id1">省</option>  
  	                </select>
                        </div>
                        <div class="col-sm-3" style="padding: 2px;">
                            <select style="padding: 2px;" class="form-control" id="add2" ng-model="selectedCity" ng-options="item[0] as item[1] for item in regionData2">  
                        <option value="" id="add_id2">市</option>  
                    </select>
                        </div>

                        <div class="col-sm-3" style="padding: 2px;">
                            <select style="padding: 2px;" class="form-control" id="add3" ng-model="selectedDstrict" ng-options="item[0] as item[1] for item in regionData3">  
                        <option value="" id="add_id3">区</option>  
                    </select>
                        </div>

                        <!-- 获取选择的区域 -->
                        <!--<div class="col-sm-3">
                        <span style="top: 7px;   width: 55px;" class="btn btn-info editable-table-button btn-xs  col-sm-4" ng-click="add_region()">添加</span>
                    </div>-->
                        <!--<div class="col-sm-12" style="padding: 0;">
                        <span style="display: inline-block;margin: 10px 5px 5px 0px;" class="tag label label-primary" ng-repeat="region in region_data">{{region}}<span data-role="remove" ng-click="region_deleta($index)">&nbsp;&nbsp;x</span></span>
                    </div>-->
                    </div>

                </div>
                <div class="col-lg-6 col-sm-12">
                    <div class="col-sm-3">
                        <h5 style="line-height: 35px;">剩余红包：</h5>
                    </div>
                    <div class="col-sm-6" style="    margin-top: 10px;">
                        <div class="col-sm-4"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOption" id="inlineRadio" value="不限" ng-click="list_data_opt.surplus='all'" ng-checked="list_data_opt.surplus=='all'"> <span>不限</span></label>
                        </div>
                        <div class="col-sm-4"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOption" id="inlineRadio" value="已抢光" ng-click="list_data_opt.surplus=true" ng-checked="list_data_opt.surplus==true"> <span>已抢光</span></label>
                        </div>
                        <div class="col-sm-4"><label class="radio-inline custom-radio nowrap">
                            <input type="radio" name="inlineRadioOption" id="inlineRadio" value="未抢光" ng-click="list_data_opt.surplus=false" ng-checked="list_data_opt.surplus==false"> <span>未抢光</span></label>
                        </div>
                    </div>
                    <div class="col-sm-2   text-right ">
                        <button type="submit " class="btn btn-primary" ng-click="search_data()">搜索</button>
                    </div>
                </div>
            </div>
        </form>

        <div style="min-height:300px;padding: 20px; ">
            <table class="table table-bordered ">
                <thead>
                    <tr valign="middle  text-center">
                        <th class="browser-icons "></th>
                        <th class=" ">红包活动名称</th>
                        <th class=" text-center ">金额 (已发／共)
                        </th>
                        <th class=" text-center ">红包 （已发放／共)
                        </th>
                        <th class=" text-center ">红包状态</th>
                        <th class=" text-center ">活动日期</th>
                        <th class=" text-center ">活动配图</th>
                        <th class=" text-center ">限定条件</th>
                        <th class=" text-center ">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in list_datas ">
                        <td class=" text-center ">{{item.num}}</td>
                        <td class=" text-center">
                            <div title="{{item.Title}}" class="iscursor" ng-click="Details(item)">
                                {{item.name|Intercept:15}}
                            </div>
                        </td>
                        <td class=" text-center">{{(item.amount-item.remainedamount)/100|currency :'￥'}}&nbsp;/&nbsp;{{(item.amount/100)|currency :'￥'}}</td>
                        <td class=" text-center ">{{item.number-item.leavings}}/{{item.number}}</td>
                        <td class=" text-center ">{{item.status|red_status}}</td>
                        <td class=" text-center ">{{item.starttime|date:'yyyy-MM-dd HH:mm'}}&nbsp;至&nbsp;{{item.endtime|date:'yyyy-MM-dd HH:mm'}}</td>
                        <td class="text-center row">
                            <span class="iscursor" ng-click="ope_img(item.mainpic,'活动主图')">活动主图</span>
                            <span class="iscursor " ng-click="ope_img(item.posters,'活动宣传图')">活动宣传图</span>
                        </td>
                        <td class=" text-center ">
                            <span ng-if="!item.is_imposed">无</span>
                            <span ng-if="item.is_imposed" class="iscursor" ng-click="red_conditionF(item.imposed) ">查看</span>
                        </td>
                        <td class=" text-center row">
                            <span class="iscursor" ng-if="item.status==5" ng-click="activation(item.id)">
                            激活红包
                            </span>
                            <span ng-if="item.status!=5">
                                <span class="iscursor" ng-click="redpacket(item.id,item.issuggest)"><span ng-if="!item.issuggest">推荐</span><span ng-if="item.issuggest">取消推荐</span></span>
                            <span class="iscursor" ng-if="is_suer_root.redpacket.indexOf('end')>-1  &&item.status==0||item.status==1" ng-click="Termination(item.id,'3')">终止</span>
                            <span class="iscursor" ng-if="is_suer_root.redpacket.indexOf('end')>-1  &&item.status==3" ng-click="Termination(item.id,'2')">取消终止</span>
                            <span class="iscursor" ng-click="red_list_Winning(item.id)">中奖记录</span>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="text-center row" style="padding: 20px; ">
                <div class="col-sm-6 text-right">
                    <ul style=" margin: 0; " uib-pagination total-items="bigTotalItems " previous-text="上一页 " next-text="下一页 " first-text="首页 " last-text="尾页 " ng-model="list_data_opt.page " ng-change="pageChanged(list_data_opt.page) " max-size="maxSize " class="pagination-sm
                " boundary-links="true " num-pages="numPages " items-per-page="list_data_opt.limit"></ul>
                </div>

                <div class="col-sm-6 text-left"><label>
                         <select style="height: 30px;font-weight: 300;" class="form-control"  selectpicker ng-model="list_data_opt.limit"  ng-change="search_data()"  ng-options="i for i in [5,10,20,50,100]">
                        </select>
                    </label> /条（每页）</div>
            </div>
        </div>
    </div>
</div>